package com.group6.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.group6.entity.Department;
import lombok.Data;

import java.io.Serializable;

public class DepartmentVo {

    @TableName(value ="department")
    @Data
    public class Department implements Serializable {
        /**
         *
         */
        @TableId(value = "DepartmentID", type = IdType.AUTO)
        private Integer departmentid;

        /**
         *
         */
        @TableField(value = "DepartmentName")
        private String departmentname;

        /**
         *
         */
        @TableField(value = "Location")
        private String location;

        @TableField(exist = false)
        private static final long serialVersionUID = 1L;

        @Override
        public boolean equals(Object that) {
            if (this == that) {
                return true;
            }
            if (that == null) {
                return false;
            }
            if (getClass() != that.getClass()) {
                return false;
            }
            com.group6.entity.Department other = (com.group6.entity.Department) that;
            return (this.getDepartmentid() == null ? other.getDepartmentid() == null : this.getDepartmentid().equals(other.getDepartmentid()))
                    && (this.getDepartmentname() == null ? other.getDepartmentname() == null : this.getDepartmentname().equals(other.getDepartmentname()))
                    && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()));
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + ((getDepartmentid() == null) ? 0 : getDepartmentid().hashCode());
            result = prime * result + ((getDepartmentname() == null) ? 0 : getDepartmentname().hashCode());
            result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
            return result;
        }

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append(getClass().getSimpleName());
            sb.append(" [");
            sb.append("Hash = ").append(hashCode());
            sb.append(", departmentid=").append(departmentid);
            sb.append(", departmentname=").append(departmentname);
            sb.append(", location=").append(location);
            sb.append(", serialVersionUID=").append(serialVersionUID);
            sb.append("]");
            return sb.toString();
        }
    }
}
